-
Notifications
You must be signed in to change notification settings - Fork 297
Convert null payloadCreator to the identity #170
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
isFunction(payloadCreator), | ||
'Expected payloadCreator to be a function or undefined' | ||
isFunction(payloadCreator) || isNull(payloadCreator), | ||
'Expected payloadCreator to be a function, undefined, or null' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove ,
=> undefined or null
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -1,22 +1,27 @@ | |||
import identity from 'lodash/identity'; | |||
import isFunction from 'lodash/isFunction'; | |||
import isUndefined from 'lodash/isUndefined'; | |||
import isNull from 'lodash/isNull'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd instead use isNil
, so we check for null
OR undefined
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
undefined
is coerced at the parameter level, so I don't think we need to check for it downstream. Let me know if I'm missing something.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are right, didn't see it 👍
Close #169.